let a: object
a = {}

//限制对象
let b: { name: string; age?: number }
b = { name: 'name' }
let c: { name: string; [propName: string]: any }

//函数声明
let d: (a: number, b: number) => void

//数组声明
let e: number[]
let g: Array<number>

//元组 固定长度的数组
let h: [string, number]
h = ['123', 123]

//enum 枚举
let i: { name: string; gender: Gender }

enum Gender {
  '女',
  '男'
}
i = { name: 'lihua', gender: Gender.女 }
console.log(i.gender === Gender.男)
let j: string | number
//定义类型
type myType = 1 | 2 | 3 | 4
let k: myType
